package cn.jolyoulu.common.web.enums;

import lombok.Data;

/**
 * @Author: JolyouLu
 * @Date: 2023/1/20 22:43
 * @Description
 */
public enum GlobalExpType implements IExpType {
    ENCRYPT_ERROR(999,"加密/解密失败"),
    NOT_CODE(1000, "验证码已过期"),
    CODE_ERROR(1001, "验证码错误"),
    USER_ACCOUNT_ERROR(1002, "用户名或密码错误"),
    USER_ACCOUNT_FORBIDDEN(1003, "该账号已被冻结，请联系管理员"),
    TOKEN_NO_AVAIL(1004, "请重新登陆"),
    UNAUTHORIZED(1005, "登录已过期，请重新登陆"),
    PARAM_ERROR(1006, "参数错误"),
    USER_REGISTER(1007, "用户已被注册"),
    OPERATION_FORBIDDEN(1007, "权限不足"),

    UNKNOWN_ERROR(9999,"未知错误")
    ;

    private final Integer code;
    private final String message;

    GlobalExpType(Integer code, String message) {
        this.code = code;
        this.message = message;
    }

    @Override
    public int code() {
        return this.code;
    }

    @Override
    public String msg() {
        return this.message;
    }
}
